#ifndef SPRITEANIMATION_H
#define SPRITEANIMATION_H

#include "Graphic.h"
#include ".\allegro\include\allegro.h"

#include <vector>


class SpriteAnimation : public Graphic{
public:
    SpriteAnimation();
    ~SpriteAnimation();

    void Deinitialize();
    void SetAnimationDelay(unsigned int delay);
    void PushFrame(BITMAP* image);
    
    void Update();  //called once per frame
    BITMAP* GetCurrentFrame();

private:
    std::vector <BITMAP*> frames;
    unsigned int animationDelay; //in frames (60 == 1 Frame per second)
    int timer;                  //counter decremented once per frame (after frame is blitted)
    unsigned int frameIndex;    //which index of the frames collection is the current frame?
};

#endif